<template>
  <div class="app-container">
    <el-form
      :model="queryParams"
      ref="queryForm"
      :inline="true"
      v-show="showSearch"
      label-width="68px"
    >
      <el-form-item label="填表日期" prop="tbrq">
        <el-date-picker
          :editable="false"
          clearable
          size="small"
          v-model="queryParams.tbrq"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="选择填表日期"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          icon="el-icon-search"
          size="mini"
          @click="handleQuery"
          >搜索</el-button
        >
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
          >重置</el-button
        >
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['Productionline_inspection_main:inspection_main:add']"
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['Productionline_inspection_main:inspection_main:edit']"
          >修改</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['Productionline_inspection_main:inspection_main:remove']"
          >删除</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-s-check"
          size="mini"
          :disabled="multiple"
          @click="handleCheck"
          v-hasPermi="['Productionline_inspection_main:inspection_main:check']"
          >审核</el-button
        >
      </el-col>
      <!--  <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['Productionline_inspection_main:inspection_main:export']"
          >导出</el-button
        >
      </el-col> -->
      <right-toolbar
        :showSearch.sync="showSearch"
        @queryTable="getList"
      ></right-toolbar>
    </el-row>

    <el-table
      v-loading="loading"
      :data="inspection_mainList"
      @selection-change="handleSelectionChange"
      max-height="550"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="序号" align="center" prop="id" width="200px" />
      <el-table-column label="填表日期" align="center" prop="tbrq" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.tbrq, "{y}-{m}-{d}") }}</span>
        </template>
      </el-table-column>
      <el-table-column label="报表编号" align="center" prop="bbbh" />
      <!-- <el-table-column label="备注" align="center" prop="remark" /> -->
      <el-table-column label="操作人" align="center" prop="czr" />
      <el-table-column label="审核人" align="center" prop="shrPerson" />
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
        min-width="250px"
      >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="excelhandleView(scope.row)"
            >导出</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleView(scope.row)"
            >查看</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['Productionline_inspection_main:inspection_main:edit']"
            >修改</el-button
          >
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="[
              'Productionline_inspection_main:inspection_main:remove',
            ]"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改制程巡检日报对话框 -->
    <!-- <el-dialog v-myFullscreen
      :title="title"
      :visible.sync="open"
      width="1500px"
      append-to-body
      v-myDialogDrag
    > -->

    <el-dialog
      v-myFullscreen
      :title="title"
      :visible.sync="open"
      width="700px"
      append-to-body
      custom-class="myDialog"
      fullscreen
    >
      <TableHeader
        @nameChange="nameChange"
        :data="{
          mainTitle: '制程巡检日报',
          company: '青岛崂山矿泉水有限公司',
          code: form.bbbh,
        }"
      />
      <el-form ref="form" :model="form" :rules="rules" label-width="90px">
        <el-row>
          <el-col :span="8">
            <el-form-item label="填表日期" prop="tbrq">
              <el-date-picker
                :editable="false"
                clearable
                v-model="form.tbrq"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="选择填表日期"
                :disabled="openDisabled"
              >
              </el-date-picker>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="12">
            <el-form-item label="报表编号" prop="bbbh">
              <el-input
                v-model="form.bbbh"
                placeholder="请输入报表编号"
                :disabled="openDisabled"
              />
            </el-form-item>
          </el-col> -->
          <!-- <el-col :span="12">
            <el-form-item label="备注" prop="remark">
              <el-input
                v-model="form.remark"
                placeholder="请输入备注"
                :disabled="openDisabled"
              />
            </el-form-item>
          </el-col> -->
        </el-row>
        <el-divider content-position="center">制程巡检日报信息</el-divider>
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button
              type="primary"
              icon="el-icon-plus"
              size="mini"
              @click="handleAddQualityProdInspectionSub"
              :disabled="openDisabled"
              >添加</el-button
            >
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="primary"
              icon="el-icon-document-copy"
              size="mini"
              @click="handleAddQualityProdInspectionSubCopy"
              :disabled="openDisabled"
              >复制</el-button
            >
          </el-col>
          <!-- <el-col :span="1.5">
            <el-button
              type="danger"
              icon="el-icon-delete"
              size="mini"
              @click="handleDeleteQualityProdInspectionSub"
              :disabled="openDisabled"
              >删除</el-button
            >
          </el-col> -->
        </el-row>

        <div class="vx_table_box">
          <RowcolTableVxeTableDit
            :tableData="tableData2"
            :reverse="true"
            class="fiexd"
            style="width: 500px"
          />
          <!-- <div class="dit_box float"> -->
          <div
            class="dit_box_cloumn float"
            v-for="(item, index) in qualityProdInspectionSubList"
            :key="index"
          >
            <div class="item">
              <el-button
                type="primary"
                icon="el-icon-delete"
                size="mini"
                @click="handleDelQualityProdInspectionSub(index)"
                :disabled="openDisabled"
                >删除</el-button
              >
            </div>
            <div class="item">
              <!-- <el-time-select :editable="false" v-model="item.a1" :picker-options="{
                  start: '00:00',
                  step: '01:00',
                  end: '24:00',
                }" placeholder="选择时间">
              </el-time-select> -->

              <el-time-picker
                :editable="false"
                clearable
                v-model="item.a62"
                type="time"
                value-format="HH:mm:ss"
                placeholder="选择填表日期"
                :disabled="openDisabled"
              >
              </el-time-picker>
            </div>
            <!-- <div class="item">
              <el-select v-model="item.a62" placeholder="请选择">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </div> -->
            <div class="item">
              <el-input
                v-model="item.a1"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a2"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a3"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a4"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a5"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a6"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a7"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a8"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a9"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a10"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a11"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a12"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <!-- <el-input v-model="item.a13" placeholder="请输入有效值" :disabled="openDisabled" /> -->
              <!-- <Dialog
                @dialogChange="dialogChangeFactory($event, index, 13)"
                :echoValue="qualityProdInspectionSubList[index].a13"
                parameter="rows"
                value="id"
                label="name"
                :multiple="true"
                search="name/code"
                url="/basic/eqpfactory/list"
                :column="['编号/code', '名称/name']"
                placeholder="请选择内容"
                :axiosData="{ type: 4 }"
              /> -->
              <!-- <treeselect
                :searchable="false"
                v-model="item.a13"
                :options="deptOptions"
                zIndex="9999"
                :appendToBody="true"
                :normalizer="normalizer"
                placeholder="请选择设备厂家"
              /> -->
              <ReportDialog
                @dialogChange="
                  (item.a13 = $event.value), (item.a13name = $event.label)
                "
                :dialogData="dialogData"
                :echoValue="item.a13"
                value="id"
                label="label"
                placeholder="选择设备厂家"
                :openDisabled="openDisabled"
                width="400px"
                size=""
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a14"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a15"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a16"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a17"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <!-- <el-input v-model="item.a18" placeholder="请输入有效值" :disabled="openDisabled" /> -->
              <!-- <Dialog
                @dialogChange="dialogChangeFactory($event, index, 18)"
                :echoValue="qualityProdInspectionSubList[index].a18"
                parameter="rows"
                value="id"
                label="name"
                :multiple="true"
                search="name/code"
                url="/basic/eqpfactory/list"
                :column="['编号/code', '名称/name']"
                placeholder="请选择内容"
                :axiosData="{ type: 4 }"
              /> -->
              <!-- <treeselect
                :searchable="false"
                v-model="item.a18"
                :options="deptOptions"
                zIndex="9999"
                :appendToBody="true"
                :normalizer="normalizer"
                placeholder="请选择设备厂家"
              /> -->
              <ReportDialog
                @dialogChange="
                  (item.a18 = $event.value), (item.a18name = $event.label)
                "
                :echoValue="item.a18"
                :dialogData="dialogData"
                value="id"
                label="label"
                placeholder="选择设备厂家"
                :openDisabled="openDisabled"
                width="400px"
                size=""
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a19"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a20"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a21"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a22"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a23"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a24"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a25"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <!-- <el-input
                v-model="item.a26"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              /> -->

              <!-- <template slot-scope="scope">
                :echoValue="scope.row.provider"

                -->
              <!-- <Dialog
                @dialogChange="dialogChangeFactory($event, index, 26)"
                :echoValue="qualityProdInspectionSubList[index].a26"
                parameter="rows"
                value="id"
                label="name"
                :multiple="true"
                search="name/code"
                url="/basic/eqpfactory/list"
                :column="['编号/code', '名称/name']"
                placeholder="请选择内容"
                :axiosData="{ type: 4 }"
              /> -->
              <!-- <treeselect
                :searchable="false"
                v-model="item.a26"
                :options="deptOptions"
                zIndex="9999"
                :appendToBody="true"
                :normalizer="normalizer"
                placeholder="请选择设备厂家"
              /> -->
              <ReportDialog
                @dialogChange="
                  (item.a26 = $event.value), (item.a26name = $event.label)
                "
                :echoValue="item.a26"
                :dialogData="dialogData"
                value="id"
                label="label"
                placeholder="选择设备厂家"
                width="400px"
                size=""
              />
              <!-- </template> -->
            </div>
            <div class="item">
              <el-input
                v-model="item.a27"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a28"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>

            <div class="item">
              <ReportDialog
                @dialogChange="
                  (item.a26new = $event.value), (item.a26newname = $event.label)
                "
                :echoValue="item.a26new"
                :dialogData="dialogData"
                value="id"
                label="label"
                placeholder="请选择对应厂家"
                width="400px"
                size=""
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a27new"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a28new"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>

            <div class="item">
              <el-input
                v-model="item.a29"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a30"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>

            <div class="item">
              <el-select
                v-model="item.a31"
                placeholder="请选择条形码"
                :disabled="openDisabled"
              >
                <el-option
                  v-for="dict in report_label_txmList"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select>

              <!-- <el-input
                v-model="item.a31"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              /> -->
              <!-- <ImageUpload2 :limit="1" :isShowTip="false" @input="qualityProdInspectionSubList[index].a31 = $event" width="80px" height="30px" :disabled="openDisabled"></ImageUpload2> -->
              <!-- <img
                :src="qualityProdInspectionSubList[index].a31"
                style="width: 80px; height: 30px"
                v-if="isShowImage"
              /> -->
            </div>

            <div class="item">
              <el-input
                v-model="item.a32"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a33"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a34"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a35"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a36"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a60"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <!-- <el-input
                v-model="item.a37"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              /> -->
              <!-- <Dialog
                @dialogChange="dialogChangeFactory($event, index, 37)"
                :echoValue="qualityProdInspectionSubList[index].a37"
                parameter="rows"
                value="id"
                label="name"
                :multiple="true"
                search="name/code"
                url="/basic/eqpfactory/list"
                :column="['编号/code', '名称/name']"
                placeholder="请选择内容"
                :axiosData="{ type: 4 }"
              /> -->
              <!-- <treeselect
                :searchable="false"
                v-model="item.a37"
                :options="deptOptions"
                zIndex="9999"
                :appendToBody="true"
                :normalizer="normalizer"
                placeholder="请选择设备厂家"
              /> -->
              <!-- <ReportDialog
                @dialogChange="
                  (item.a37 = $event.value), (item.a37name = $event.label)
                "
                :echoValue="item.a37"
                :dialogData="dialogData"
                value="id"
                label="label"
                placeholder="选择设备厂家"
                :openDisabled="openDisabled"
                width="400px"
                size=""
              /> -->
              <treeselect
                v-model="item.a37Arry"
                :disable-branch-nodes="true"
                :options="dialogData"
                :limit="2"
                placeholder="选择设备厂家"
                :normalizer="normalizer2"
                :searchable="false"
                :appendToBody="false"
                @select="addSelect"
                multiple
                :disabled="openDisabled"
                collapse-tags
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a38"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a39"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <!-- <el-input
                v-model="item.a40"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              /> -->
              <!-- <Dialog
                @dialogChange="dialogChangeFactory($event, index, 40)"
                :echoValue="qualityProdInspectionSubList[index].a40"
                parameter="rows"
                value="id"
                label="name"
                :multiple="true"
                search="name/code"
                url="/basic/eqpfactory/list"
                :column="['编号/code', '名称/name']"
                placeholder="请选择内容"
                :axiosData="{ type: 4 }"
              /> -->
              <!-- <treeselect
                :searchable="false"
                v-model="item.a40"
                :options="deptOptions"
                zIndex="9999"
                :appendToBody="true"
                :normalizer="normalizer"
                placeholder="请选择设备厂家"
              /> -->
              <!-- <el-cascader
                style="width: 100%"
                :options="dialogData"
                :props="{ multiple: true, value: 'id' }"
                clearable
                collapse-tags
                v-model="item.a40"
              ></el-cascader> -->
              <!-- <treeselect
                v-model="item.a40"
                :disable-branch-nodes="true"
                :options="dialogData"
                placeholder="选择设备厂家"
                :normalizer="normalizer2"
                :searchable="false"
                :appendToBody="false"
                multiple
                :disabled="openDisabled"
                collapse-tags
              /> -->
              <ReportDialog
                @dialogChange="
                  (item.a40 = $event.value), (item.a40name = $event.label)
                "
                :dialogData="dialogData"
                :echoValue="item.a40"
                value="id"
                label="label"
                placeholder="选择设备厂家"
                :openDisabled="openDisabled"
                width="400px"
                size=""
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a41"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a42"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a43"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-select
                v-model="item.a44Arry"
                multiple
                placeholder="请选择条形码"
                :disabled="openDisabled"
              >
                <el-option
                  v-for="dict in report_paperpack_txmList"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select>

              <!-- <ImageUpload2 :limit="1" :isShowTip="false" @input="qualityProdInspectionSubList[index].a44 = $event" v-if="isShowImageUpload2" width="80px" height="30px" :disabled="openDisabled"></ImageUpload2> -->
              <!-- <el-input
                v-model="item.a44"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              /> -->
              <!-- <Dialog
                  @dialogChange="dialogChangeFactory($event,index,44)"
                  :echoValue="qualityProdInspectionSubList[index].a44"
                  parameter="rows"
                  value="id"
                  label="name"
                  :multiple="true"
                  search="name/code"
                  url="/basic/eqpfactory/list"
                  :column="['产成品编号/code', '产成品名称/name']"
                  placeholder="请选择内容"
                  :axiosData="{ type: 4 }"
                /> -->
            </div>
            <div class="item">
              <el-input
                v-model="item.a45"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a46"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a47"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a48"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a49"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a50"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a51"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a52"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a53"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a54"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <div class="item">
              <el-input
                v-model="item.a55"
                placeholder="请输入有效值"
                :disabled="openDisabled"
              />
            </div>
            <!-- <div class="item">
              <el-input v-model="item.a56" placeholder="请输入有效值" :disabled="openDisabled" />
            </div> -->

            <!-- <div class="item">
              <el-select v-model="item.a56">
                <el-option value="是">是</el-option>
                <el-option value="否">否</el-option>
              </el-select>
            </div>

            <div class="item">
              <el-select v-model="item.a57">
                <el-option value="是">是</el-option>
                <el-option value="否">否</el-option>
              </el-select>
            </div>

            <div class="item">
              <el-select v-model="item.a58">
                <el-option value="是">是</el-option>
                <el-option value="否">否</el-option>
              </el-select>
            </div>
            <div class="item">
              <el-input v-model="item.a59" placeholder="请输入有效值" :disabled="openDisabled" />
            </div> -->
            <div class="item">
              <!-- <el-select v-model="item.a63" placeholder="请选择品项" :disabled="openDisabled">
                <el-option
                  v-for="(dict,index) in px"
                  :key="index+'aa'"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
              </el-select> -->

              <pxDialog
                @dialogChange="item.a63 = $event.value"
                :echoValue="item.a63"
                parameter="data"
                value="dictValue"
                label="dictLabel"
                :multiple="false"
                url="/Productionline/inspection_main/getPx"
                :column="['品项名称/dictLabel']"
                placeholder="请选择内容"
                :openDisabled="openDisabled"
                width="400px"
                size=""
              />
            </div>
          </div>
        </div>

        <el-col :span="24">
          <el-form-item
            label-width="490px"
            label="开机前用75%酒精清擦灌装机拨盘、星轮、台面"
            prop="bz1"
          >
            <el-select v-model="form.bz1">
              <el-option value="是">是</el-option>
              <el-option value="否">否</el-option>
            </el-select>
          </el-form-item>

          <el-form-item
            label-width="490px"
            label="开机前使用灌装水冲洗管路1min、CIP冲洗灌装5min"
            prop="bz2"
          >
            <el-select v-model="form.bz2">
              <el-option value="是">是</el-option>
              <el-option value="否">否</el-option>
            </el-select>
          </el-form-item>

          <el-form-item
            label-width="490px"
            label="班后使用1.0-1.5mg/L的臭氧水冲洗浸泡生产管路及环形缸、灌装阀"
            prop="bz3"
          >
            <el-select v-model="form.bz3">
              <el-option value="是">是</el-option>
              <el-option value="否">否</el-option>
            </el-select>
          </el-form-item>

          <el-form-item
            label-width="490px"
            label="班后使用臭氧浓度 mg/L"
            prop="bz4"
          >
            <el-input v-model="form.bz4" :disabled="openDisabled" />
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="审核人" prop="shrPerson">
            <el-input v-model="form.shrPerson" :disabled="true" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="操作人" prop="czr">
            <!-- <el-input
              v-model="form.czr"
              :disabled="true"
            /> -->

            <UserDialog
              @dialogChange="form.czr = $event.label"
              :echoValue="form.czr"
              :multiple="false"
              :openDisabled="openDisabled"
              placeholder="请选择人员"
            />
          </el-form-item>
        </el-col>
      </el-form>
      <div slot="footer" class="dialog-footer" v-if="!openDisabled">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import ImageUpload2 from "@/components/ImageUpload/index2.vue";
import { listSelect2 } from "@/api/report/process/label";
import {
  listInspection_main,
  getInspection_main,
  delInspection_main,
  addInspection_main,
  updateInspection_main,
  checkInspection_main,
  getPx,
} from "@/api/quality/productionline/inspection_main";
import { listEqpfactory } from "@/api/basic/eqpfactory/eqpfactory";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";

export default {
  name: "Inspection_main",
  components: { Treeselect, ImageUpload2 },
  data() {
    return {
      options: [
        {
          value: "选项1",
          label: "黄金糕",
        },
        {
          value: "选项2",
          label: "双皮奶",
        },
        {
          value: "选项3",
          label: "蚵仔煎",
        },
        {
          value: "选项4",
          label: "龙须面",
        },
        {
          value: "选项5",
          label: "北京烤鸭",
        },
      ],
      // 上传组件的显示
      isShowImageUpload2: true,
      // 图片的预览
      isShowImage: true,
      dialogData: [],
      // 图片
      fileList: [],
      //弹窗是否禁止编辑
      openDisabled: true,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      px: [],
      // 子表选中数据
      checkedQualityProdInspectionSub: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 制程巡检日报表格数据
      inspection_mainList: [],
      // 制程巡检日报表格数据
      qualityProdInspectionSubList: [],
      //生产过程_贴标机_条形码
      report_label_txmList: [],
      //生产过程_纸包_条形码
      report_paperpack_txmList: [],
      // 弹出层标题
      title: "- -",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 50,
        tbrq: null,
      },
      // 表单参数
      form: {},
      // 树选项
      deptOptions: [],
      // 表单校验
      rules: {},
      tableData2: {
        columns: [
          {
            title: "",
          },
          {
            title: "",
          },
          {
            title: "水源间",
            children: [
              {
                title: "储水罐有效氯",
              },
              {
                title: "储水罐pH值",
              },
              {
                title: "碳滤余氯残留",
              },
            ],
          },
          {
            title: "水处理",
            children: [
              {
                title: "一二级精滤压差",
              },
              {
                title: "二三级精滤压差",
              },
            ],
          },
          {
            title: "冲盖",
            children: [
              {
                title: "臭氧浓度",
              },
              {
                title: "冲盖效果",
              },
            ],
          },
          {
            title: "灌装水",
            children: [
              {
                title: "水温",
              },
              {
                title: "电导率",
              },
              {
                title: "pH值",
              },
              {
                title: "臭氧浓度",
              },
            ],
          },
          {
            title: "瓶坯",
            children: [
              {
                title: "规格、外观、异味",
              },
              {
                title: "厂商",
              },
              {
                title: "批次号",
              },
              {
                title: "使用情况",
              },
            ],
          },
          {
            title: "空瓶",
            children: [
              {
                title: "外观、异味",
              },
            ],
          },
          {
            title: "灌装",
            children: [
              {
                title: "净含量",
              },
            ],
          },
          {
            title: "封盖",
            children: [
              {
                title: "厂商",
              },
              {
                title: "批次号",
              },
              {
                title: "使用情况",
              },
              {
                title: "盖消毒",
              },
              {
                title: "瓶盖外观、异味",
                // children: [
                //   {
                //     title: "盖消qqq毒",
                //   },
                // ],
              },
              {
                title: "开启扭矩",
              },
              {
                title: "断环扭矩",
              },
              {
                title: "封盖密封性",
              },
            ],
          },
          {
            title: "贴标",
            children: [
              {
                title: "标签厂商",
              },
              {
                title: "标签批次号",
              },
              {
                title: "标签使用情况",
              },
              {
                title: "热熔胶厂商",
              },
              {
                title: "热熔胶批次号",
              },
              {
                title: "热熔胶使用情况",
              },
              {
                title: "印刷",
              },
              {
                title: "位置",
              },
              {
                title: "条形码",
              },
            ],
          },
          {
            title: "瓶喷码",
            children: [
              {
                title: "日期喷印",
              },
            ],
          },
          {
            title: "留样登记",
            children: [
              {
                title: "瓶坯",
              },
              {
                title: "瓶盖",
              },
              {
                title: "商标",
              },
              {
                title: "纸箱",
              },
              {
                title: "热缩膜",
              },
            ],
          },
          {
            title: "包装",
            children: [
              {
                title: "纸箱（膜）厂商",
              },
              {
                title: "纸箱（膜）批次号",
              },
              {
                title: "纸箱（膜）使用情况",
              },
              {
                title: "纸箱热熔胶厂商",
              },
              {
                title: "纸箱热熔胶批次号",
              },
              {
                title: "纸箱热熔胶使用情况",
              },
              {
                title: "纸箱/塑封",
              },
              {
                title: "条形码",
              },
              {
                title: "产品",
              },
            ],
          },
          {
            title: "箱喷码",
            children: [
              {
                title: "外观",
              },
            ],
          },
          {
            title: "码垛",
            children: [
              {
                title: "外观",
              },
            ],
          },
          {
            title: "品评",
            children: [
              {
                title: "臭和味",
              },
              {
                title: "可见物",
              },
              {
                title: "氧气、二氧化碳",
              },
              {
                title: "浊度",
              },
              {
                title: "色度",
              },
              {
                title: "正向旋转扭力",
              },
            ],
          },
          {
            title: "设备",
            children: [
              {
                title: "工艺卫生",
              },
            ],
          },
          {
            title: "净化间",
            children: [
              {
                title: "送风效果",
              },
            ],
          },
          // {
          //   title: "备注",
          //   children: [
          //     {
          //       title: "开机前用75%酒精清擦灌装机拨盘、星轮、台面",
          //     },
          //     {
          //       title: "开机前使用灌装水冲洗管路1min、CIP冲洗灌装阀5min",
          //     },
          //     {
          //       title:
          //         "班后使用1.0-1.5mg/L的臭氧水冲洗浸泡生产管路及环形缸、灌装阀",
          //     },
          //     {
          //       title: "班后使用臭氧浓度 mg/L",
          //     },
          //   ],
          // },
          {
            title: "物料",
            children: [
              {
                title: "品项",
              },
            ],
          },
        ],
        data: [],
        label: [
          "操作",
          "时间",
          "2.0-3.0mg/L",
          "5.95-6.20",
          "无",
          "<0.1MPa",
          "<0.1MPa",
          "0.8-1.2mg/L",
          "无异物残留",
          "实测值",
          ">160μs/cm",
          "6.0-6.3",
          "0.10-0.3mg/L",
          "坯口、坯身成型良好，无生料、气泡、杂质；无溢料毛边、拉丝、异味",
          "成型饱满、壁厚均匀、底部平整，瓶体站立平稳，不变形，色正常，无异味",
          "- -",
          "- -",
          "成型饱满、壁厚均匀、底部平整，瓶体站立平稳，不变形，色正常，无异味",
          "≥标注(ML)",
          "- -",
          "- -",
          "- -",
          "臭氧消毒30分钟",
          "内袋完好，盖成型完整，色泽正常，无杂质、异物、异味",
          "8-15 kgf.cm",
          "8-15 kgf.cm",
          "2.0kg/cm260s不渗漏，无外观不良",
          "- -",
          "- -",
          "- -",
          "- -",
          "- -",
          "- -",
          "无跑版、缺失、色差",
          "错位差<1.5mm",
          "条形码正确 (记录实际条码内容)",
          "日期正确，字符清晰  (记录实际喷印内容)",
          "- -",
          "- -",
          "- -",
          "- -",
          "- -",
          "- -",
          "- -",
          "- -",
          "- -",
          "- -",
          "- -",
          "成形周正，印刷清晰，牢固，无开裂",
          "条形码正确(记录实际条码内容)",
          "不缺瓶，外观良好",
          "日期正确，字符清晰(记录实际喷印内容)",
          "码放整齐、方向正确",
          "不得有异臭、异味",
          "无肉眼可见异物",
          "不得有异臭、异味",
          "<1",
          "<5",
          "0-16°",
          "符合工艺卫生要求，不应导致产品二次污染，不影响产品质量",
          "正压",
          "- -",
          "- -",
          "- -",
          "- -",
          "- -",
        ],
      },
    };
  },
  created() {
    this.getList();
    this.queryPx();
    this.getListfac();
    //生产过程_贴标机_条形码
    this.getDicts("report_label_txm").then((response) => {
      this.report_label_txmList = response.data;
    });
    //生产过程_纸包_条形码
    this.getDicts("report_paperpack_txm").then((response) => {
      this.report_paperpack_txmList = response.data;
    });
  },
  methods: {

    addSelect(value){

        console.log(value);
       // this.selectList = value.label

    },
    /** 转换数据结构 */
    normalizer(node) {
      if (node.children && !node.children.length) {
        delete node.children;
      }
      return {
        id: node.id,
        label: node.name,
        children: node.children,
      };
    },
    /** 转换数据结构 */
    normalizer2(node) {
      if (node.children && !node.children.length) {
        delete node.children;
      }
      return {
        id: node.id,
        label: node.label,
        children: node.children,
      };
    },
    queryPx() {
      getPx().then((response) => {
        this.px = response.data;
        // console.log(response.data);
      });
    },
    getListfac() {
      listSelect2().then((response) => {
        this.dialogData = response.rows;
        // console.log(this.dialogData);
        /*        this.selectionLabel = this.findPathByLeafId(
          this.echoValue,
          this.tableData
        );*/
      });
    },
    dialogChangeFactory(event, index, flag) {
      // console.log(event);
      if (flag == 13) {
        this.qualityProdInspectionSubList[index].a13 = event.label;
      }
      if (flag == 18) {
        this.qualityProdInspectionSubList[index].a18 = event.label;
      }
      if (flag == 26) {
        this.qualityProdInspectionSubList[index].a26 = event.label;
      }
      if (flag == 37) {
        this.qualityProdInspectionSubList[index].a37 = event.label;
      }
      if (flag == 40) {
        this.qualityProdInspectionSubList[index].a40 = event.label;
      }
      if (flag == 44) {
        this.qualityProdInspectionSubList[index].a44 = event.label;
      }
      // this.rptProLabelCheckList[scope.$index].provider = event.label;
    },
    /** 查询制程巡检日报列表 */
    getList() {
      this.loading = true;
      listInspection_main(this.queryParams).then((response) => {
        this.inspection_mainList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        tbrq: null,
        bbbh: "LK-QF-LS1-10-015-11-05",
        czr: this.$store.state.user.nickName,
        shrPerson: null,
        remark: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        delFlag: null,
        bz1: null,
        bz2: null,
        bz3: null,
        bz4: null,
      };
      this.qualityProdInspectionSubList = [];
      this.rptProLabelCheckList = [];
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.selectRow = selection;
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.openDisabled = false;
      this.open = true;
      this.title = "添加制程巡检日报";
      this.form.tbrq = new Date();
      this.form.czr = this.$store.state.user.nickName;
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      this.openDisabled = false;
      const id = row.id || this.ids;
      getInspection_main(id).then((response) => {
        this.form = response.data;
        for (let item of response.data.qualityProdInspectionSubList) {
          if (item.a37Arry == "") {
            item.a37Arry = null;
          }
        }
        this.qualityProdInspectionSubList =
          response.data.qualityProdInspectionSubList;
        this.open = true;
        this.title = "修改制程巡检日报";
      });
    },
    /** 查看按钮 */
    handleView(row) {
      this.reset();
      this.openDisabled = true;
      const id = row.id || this.ids;
      getInspection_main(id).then((response) => {
        this.form = response.data;
        for (let item of response.data.qualityProdInspectionSubList) {
          if (item.a37Arry == "") {
            item.a37Arry = null;
          }
        }
        this.qualityProdInspectionSubList =
          response.data.qualityProdInspectionSubList;
        this.open = true;
        this.title = "查看制程巡检日报";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          this.form.qualityProdInspectionSubList =
            this.qualityProdInspectionSubList;
          /**打开遮罩层*/
          const rLoading = this.openLoading();
          if (this.form.id != null) {
            updateInspection_main(this.form)
              .then((response) => {
                /**成功后执行关闭遮罩层*/
                rLoading.close();
                this.msgSuccess("修改成功");
                this.open = false;
                this.getList();
              })
              .catch((error) => {
                /**请求异常后执行关闭遮罩层*/
                rLoading.close();
              });
          } else {
            addInspection_main(this.form)
              .then((response) => {
                /**成功后执行关闭遮罩层*/
                rLoading.close();
                this.msgSuccess("新增成功");
                this.open = false;
                this.getList();
              })
              .catch((error) => {
                /**请求异常后执行关闭遮罩层*/
                rLoading.close();
              });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$confirm(
        '是否确认删除制程巡检日报编号为"' + ids + '"的数据项?',
        "警告",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        }
      )
        .then(function () {
          return delInspection_main(ids);
        })
        .then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    /** 制程巡检日报序号 */
    rowQualityProdInspectionSubIndex({ row, rowIndex }) {
      row.index = rowIndex + 1;
    },
    /** 制程巡检日报添加按钮操作 */
    handleAddQualityProdInspectionSub() {
      let hh =
        new Date().getHours() < 10
          ? "0" + new Date().getHours()
          : new Date().getHours();
      let mf =
        new Date().getMinutes() < 10
          ? "0" + new Date().getMinutes()
          : new Date().getMinutes();
      let ss =
        new Date().getSeconds() < 10
          ? "0" + new Date().getSeconds()
          : new Date().getSeconds();
      let timer = hh + ":" + mf + ":" + ss;
      let obj = {};
      obj.a1 = "";
      obj.a2 = "";
      obj.a3 = "无";
      obj.a4 = "<0.1";
      obj.a5 = "<0.1";
      obj.a6 = "1.0";
      obj.a7 = "无";
      obj.a8 = "";
      obj.a9 = "";
      obj.a10 = "";
      obj.a11 = "";
      obj.a12 = "合格";
      obj.a13 = null;
      obj.a13name = null;
      obj.a14 = "";
      obj.a15 = "良好";
      obj.a16 = "合格";
      obj.a17 = "";
      obj.a18 = null;
      obj.a19 = "";
      obj.a20 = "良好";
      obj.a21 = "合格";
      obj.a22 = "合格";
      obj.a23 = "";
      obj.a24 = "";
      obj.a25 = "合格";
      obj.a26 = null;
      obj.a27 = "";
      obj.a28 = "良好";
      obj.a26new = null;
      obj.a27new = "";
      obj.a28new = "良好";
      obj.a29 = "合格";
      obj.a30 = "0";
      obj.a31 = "";
      obj.a32 = "";
      obj.a33 = "";
      obj.a34 = "";
      obj.a35 = "";
      obj.a36 = "0";
      obj.a37 = null;
      obj.a38 = "";
      obj.a39 = "良好";
      obj.a40 = null;
      obj.a41 = "";
      obj.a42 = "良好";
      obj.a43 = "合格";
      obj.a44 = "";
      obj.a45 = "合格";
      obj.a46 = "";
      obj.a47 = "合格";
      obj.a48 = "合格";
      obj.a49 = "合格";
      obj.a50 = "合格";
      obj.a51 = "0";
      obj.a52 = "0";
      obj.a53 = "0";
      obj.a54 = "合格";
      obj.a55 = "合格";
      obj.a56 = "";
      obj.a57 = "";
      obj.a58 = "";
      obj.a59 = "";
      obj.a60 = "0";
      obj.a61 = "";
      obj.a62 = timer;
      obj.bbbh = "";
      obj.remark = "";
      // (obj.date = "2012-23-12"),
      //   (obj.value1 = 1111111),
      //   (obj.value2 = 2222222),
      //   (obj.value3 = 3333333),
      //   (obj.value4 = 4444444),
      //   (obj.value5 = 5555555),
      //   (obj.value6 = 6666666),
      //   (obj.value7 = 7777777),
      //   (obj.value8 = 8888888),
      //   (obj.value9 = 9999999),
      //   (obj.value10 = 10101010),
      //   (obj.value11 = 11111111),
      //   (obj.value12 = 12121212),
      //   (obj.value13 = 13131313),
      //   (obj.value14 = 14141414),
      this.qualityProdInspectionSubList.push(obj);
      // console.log(this.qualityProdInspectionSubList);
      // this.tableData2.data.push(obj);
      listEqpfactory().then((response) => {
        this.deptOptions = this.handleTree(response.data, "id");
      });
    },
    handleAddQualityProdInspectionSubCopy() {
      var last =
        this.qualityProdInspectionSubList[
          this.qualityProdInspectionSubList.length - 1
        ];

      let obj = {};
      obj.a1 = last.a1;
      obj.a2 = last.a2;
      obj.a3 = last.a3;
      obj.a4 = last.a4;
      obj.a5 = last.a5;
      obj.a6 = last.a6;
      obj.a7 = last.a7;
      obj.a8 = last.a8;
      obj.a9 = last.a9;
      obj.a10 = last.a10;
      obj.a11 = last.a11;
      obj.a12 = last.a12;
      obj.a13 = last.a13;
      obj.a13name = last.a13name;
      obj.a14 = last.a14;
      obj.a15 = last.a15;
      obj.a16 = last.a16;
      obj.a17 = last.a17;
      obj.a18 = last.a18;
      obj.a19 = last.a19;
      obj.a20 = last.a20;
      obj.a21 = last.a21;
      obj.a22 = last.a22;
      obj.a23 = last.a23;
      obj.a24 = last.a24;
      obj.a25 = last.a25;
      obj.a26 = last.a26;
      obj.a27 = last.a27;
      obj.a28 = last.a28;
      obj.a26new = last.a26new;
      obj.a27new = last.a27new;
      obj.a28new = last.a28new;

      obj.a18name = last.a18name;
      obj.a26name = last.a26name;
      obj.a26newname = last.a26newname;
      obj.a40name = last.a40name;
      obj.a29 = last.a29;
      obj.a30 = last.a30;
      obj.a31 = last.a31;
      obj.a32 = last.a32;
      obj.a33 = last.a33;
      obj.a34 = last.a34;
      obj.a35 = last.a35;
      obj.a36 = last.a36;
      obj.a37 = last.a37;
      obj.a38 = last.a38;
      obj.a39 = last.a39;
      // obj.a40 = last.null;
      obj.a41 = last.a41;
      obj.a42 = last.a42;
      obj.a43 = last.a43;
      obj.a44 = last.a44;
      obj.a45 = last.a45;
      obj.a46 = last.a46;
      obj.a47 = last.a47;
      obj.a48 = last.a48;
      obj.a49 = last.a49;
      obj.a50 = last.a50;
      obj.a51 = last.a51;
      obj.a52 = last.a52;
      obj.a53 = last.a53;
      obj.a54 = last.a54;
      obj.a55 = last.a55;
      obj.a56 = last.a56;
      obj.a57 = last.a57;
      obj.a58 = last.a58;
      obj.a59 = last.a59;
      obj.a60 = last.a60;
      obj.a61 = last.a61;
      obj.a62 = last.a62;
      obj.bbbh = "";
      obj.remark = "";
      if (last.a37Arry == "") {
        obj.a37Arry = null;
      } else {
        obj.a37Arry = last.a37Arry;
      }
      // console.log(last);
      this.qualityProdInspectionSubList.push(obj);
    },
    /** 制程巡检日报删除按钮操作 */
    handleDeleteQualityProdInspectionSub() {
      if (this.checkedQualityProdInspectionSub.length == 0) {
        this.$alert("请先选择要删除的制程巡检日报数据", "提示", {
          confirmButtonText: "确定",
        });
      } else {
        this.qualityProdInspectionSubList.splice(
          this.checkedQualityProdInspectionSub[0].index - 1,
          1
        );
      }
    },
    /** 单选框选中数据 */
    handleQualityProdInspectionSubSelectionChange(selection) {
      if (selection.length > 1) {
        this.$refs.qualityProdInspectionSub.clearSelection();
        this.$refs.qualityProdInspectionSub.toggleRowSelection(selection.pop());
      } else {
        this.checkedQualityProdInspectionSub = selection;
      }
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download(
        "Productionline_inspection_main/inspection_main/export",
        {
          ...this.queryParams,
        },
        "制程巡检日报" + this.parseTime(new Date()) + ".xlsx"
      );
    },
    excelhandleView(row) {
      //Boolean isVertical,int isTitle,Boolean autoAddLine
      //isVertical:true为竖表；false为横表。竖表时isTitle和autoAddLine参数无意义
      //isTitle:1为自动添加标题，{+sub_startlog+}所在行为标题；0为不添加标题，{+sub_startlog+}所在行为第一条数据。
      //autoAddLine:true为自动添加新行；false不添加新行。
      this.download(
        "Productionline/inspection_main/exportexcel?isVertical=true&isTitle=0&autoAddLine=false&id=" +
          row.id,
        {
          ...this.queryParams,
        },
        "制程巡检日报表" + this.parseTime(new Date()) + ".xlsx"
      );
    },
    /** 审核按钮操作 */
    handleCheck(row) {
      /* 审核 */
      this.selectRow.forEach((e) => {
        if (e.shrPerson != null && e.shrPerson != "") {
          this.msgError("数据项已审核完成，无需重复审核！");
        } else {
          let obj = {};
          obj.id = e.id;
          obj.shrPerson = this.$store.state.user.nickName;
          if (obj.shrPerson == e.czr) {
            this.msgError("审核人与操作人不能为同一人！");
          } else {
            /* 修改 */
            checkInspection_main(obj).then((response) => {
              this.msgSuccess("审核成功！");
              this.getList();
            });
          }
        }
      });
    },
    //接收编号
    nameChange(e) {
      this.form.bbbh = e;
    },
    // 删除数据
    handleDelQualityProdInspectionSub(index) {
      this.$confirm("是否确认删除数据项?", "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(function () {
          // return delInspection_main(ids);
        })
        .then(() => {
          this.qualityProdInspectionSubList.splice(index, 1);
          this.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
  },
};
</script>
<style lang="scss">
.vx_table_box {
  width: 100%;
  height: 45vh;
  position: relative;
  display: flex;
  overflow-x: auto;
  transform: translate(0, 0);

  .fiexd {
    left: 0;
    background: rgba(9, 59, 118, 0.9);
    /* height:auto; */
    // z-index:2;
    z-index: 2000;
    position: sticky;
  }
  .dit_box_cloumn {
    .item {
      width: 430px;
      height: 48px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0 15px;
      border: 1px solid rgba(31, 179, 255, 0.2) !important;
      //  border-right:1px solid rgba(31, 179, 255, 0.2)!important;
    }
  }
}
.float {
  float: left;
}
.el-dialog.is-fullscreen {
  .vx_table_box {
    width: 100%;
    height: 57vh;
  }
}
</style>
<style>
.vue-treeselect__limit-tip-text {
  position: relative;
  top: -6px;
}
</style>
